//accepted
#include <cstdio>

int main(){
	//freopen("in.txt", "r", stdin);
	int n, i, a, sum,ss;
	
	scanf("%d", &n);
	while(n){
		scanf("%d", &a);
		ss=sum=a;
		for(i=1;i<n;++i){
			scanf("%d", &a);
			sum= (sum+a>a)?(sum+a):(a);
			ss= (ss>sum)?(ss):(sum);
		}
		if(ss>0)printf("The maximum winning streak is %d.\n", ss );
		else printf("Losing streak.\n");
		
		
		
		scanf("%d", &n);
	}

	return 0;
}
